<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <title>Title</title>
    <base href="<%=basePath%>">
    <meta charset="utf-8">
    <script type="application/javascript" src="js/jquery.js"></script>
    <link rel="stylesheet" type="text/css" href="css/order-css.css"/>
    <link rel="stylesheet" type="text/css" href="css/order-css1.css"/>
    <script type="application/javascript">

        function detail(orderId) {
            var $parent = $(window.parent.document);
            var url = "${path}/orderAction!searchOrder?orderId=" + orderId;
            $parent.find("#frame").attr("src", url);
        }
        function queren(id) {
            var se = confirm("是否付款");
            if (se == true) {
                window.location = "${path}/orderAction!pay?orderId=" + id;
            }
            else {

            }
        }
        function comment(orderId) {
            var $parent = $(window.parent.document);
            var url = "${path}/orderAction!showCommentView?orderId=" + orderId;
            $parent.find("#frame").attr("src", url);
        }

        function showcomment(orderId) {
            var $parent = $(window.parent.document);
            var url = "${path}/orderAction!showComment?orderId=" + orderId;
            $parent.find("#frame").attr("src", url);
        }
    </script>
</head>
<body>
<div class="align-center" style="margin:0 auto;width:900px;margin-top: 10px">
    <div class="orders-wrapper" id="order-list">
        <div class="orders-head">
            <div class="order-cell order-info">酒店信息</div>
            <div class="order-cell order-money">总价</div>
            <div class="order-cell order-status">订单状态</div>
            <div class="order-cell order-op">操作</div>
        </div>
        <s:iterator value="orders" var="order">
            <div class="J-order-w">
                <div class="order-title">
                    订单编号：
                    <a href="" target="_blank">
                        <s:property value="#order.orderId"/>
                    </a>
                    <a class="order-delete"
                       href="${path}/orderAction!delete?orderId=<s:property value="#order.orderId"/>">删除</a>
                </div>
                <div class="order-row">
                    <div class="order-row--sub order-row--last">
                        <div class="order-cell order-info">
                            <div class="deal-info cf">
                                <a class="img-w"
                                   target="_blank"
                                   data-mod-mtt="1.orders/list.0.0.isv6ypm6">
                                    <img src="http://images4.c-ctrip.com/target/fd/tuangou/g1/M09/99/39/CghzfVVy-_OAaIfgAAD7e7NzJOk343_720_480_s.jpg"
                                         width="81" height="50">
                                </a>
                                <div class="info-detail">
                                        ${order.orderContext}
                                </div>
                            </div>
                        </div>
                        <div class="order-cell order-money">
                            <span class="money">¥</span>${order.price}
                            <br><span class="delivery-text">
                            </span>
                        </div>
                        <div class="order-cell order-status">
                            <s:if test="#order.state == 0">
                                过期
                            </s:if>
                            <s:if test="#order.state == 1">
                                待取消
                            </s:if>
                            <s:if test="#order.state == 2">
                                已取消
                            </s:if>
                            <s:if test="#order.state == 3">
                                未支付
                            </s:if>
                            <s:if test="#order.state == 4">
                                已支付
                            </s:if>
                            <div>
                                <a gaevent="/orders//editfeedback"
                                   target="_blank"
                                   id="detial"
                                   onclick="detail(<s:property value="#order.orderId"/>)">订单详情</a>
                            </div>
                        </div>
                        <div class="order-cell order-op">
                            <s:if test="#order.state == 3">
                                <a gaevent="/orders//editfeedback" target="_blank"
                                   onclick="queren(<s:property value="#order.orderId"/>)">付款</a>
                            </s:if>
                            <s:if test="#order.state == 4">
                                <s:if test="#order.comment == null">
                                    <a target="_blank"
                                       onclick="comment(<s:property value="#order.orderId"/>)">评价</a>
                                </s:if>
                                <s:else>
                                    <a target="_blank"
                                       onclick="showcomment(<s:property value="#order.orderId"/>)">查看评价</a>
                                </s:else>
                            </s:if>
                        </div>
                    </div>
                </div>
            </div>
        </s:iterator>
        <div class="paginator-wrapper"></div>
        <p class="bottom-tips"></p>
    </div>
</div>
<br>
<br>
<br>
</body>
</html>
